畅梦影视[优].js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  2. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  3. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  4. globalThis.getHeaders = function (input) {
  5. let t = new Date().getTime().toString();
  6. let headers = {
  7. 'version_name': '1.0.6',
  8. 'version_code': '6',
  9. 'package_name': 'com.app.nanguatv',
  10. 'sign': md5('c431ea542cee9679#uBFszdEM0oL0JRn@' + t).toUpperCase(),
  11. 'imei': 'c431ea542cee9679',
  12. 'timeMillis': t,
  13. 'User-Agent': 'okhttp/4.6.0'
  14. };
  15. return headers
  16. }
  17. var rule = {
  18. title: '畅梦影视[优]',
  19. host: 'http://ys.changmengyun.com',
  20. homeUrl: '/api.php/provide/vod_rank?app=ylys&sort_type=month&imei=c431ea542cee9679&id=2&page=1',
  21. url: '/api.php/provide/vod_list?app=ylys&id=fyclassfyfilter&page=fypage&imei=c431ea542cee9679',
  22. detailUrl: '/api.php/provide/vod_detail?app=ylys&imei=c431ea542cee9679&id=fyid',
  23. searchUrl: '/api.php/provide/search_result_more?app=ylys&video_name=**&pageSize=20&tid=0&imei=c431ea542cee9679&page=fypage',
  24. searchable: 2,
  25. quickSearch: 0,
  26. filterable: 1,
  27. filter_url: '&area={{fl.area}}&year={{fl.year}}&type={{fl.class}}&total={{fl.total or "状态"}}&order={{fl.by or "新上线"}}',
  28. filter: 'H4sIAAAAAAAAA+2XUXPSQBDHv0ueeQBqKfSrOH2IDk9inWmrM0yHmVakFtqC1hm0FqsdW4JjKUFrLcG0XyZ3gW9hwuV293AGikZfzBu///5z2Vx298K6ltAW765rD7J5bVG7n9NXV7WYtqw/zHrodvvsaMfjJ3rucXbkW/ZkVmoNiy1fRk8hFsQqLcduuOXnQRgZHPUGKxvEASwd7naXF0voQAaH8ZL1+sQBLB188wXfqKMDGfIoG8pdkGGN7TeOVSZrAIOjWOFP3xIHcGHJ94hd1VeyOm4qa5hs15q8qYEHUt2rDjptGRMgY8PmAb/q4KLjEmzZdZUd2nK/BMBjnBn84ot8BgGw/vtPeF0AcN3rU944k9cJgJxrJu9dK3kpEqzx1cT1A5h1DbZnMqsJ+zMCiJUu2XlRxgTQl5PP6ivk5fQunL495eUIj7xBMp6cCyKjn0RPop6kegL1BNXjqMeJnsiA7v0kehr1NNUXUF+gegr1FNXnUZ8HPREfPejHIAYo43E1Hh+PZ9R4ZjyeVuOA9OXcy+Or4dV9ZtV+eTVusc3327zZkKUNDBVwag86z9CBDDVYN52rimvdyDIE9pJZimnJcEfkoe1YhjduZD7AkI/XvTUTHcjhjpWtkqfImIBZx8rUFo1aLWq1GVptLtxWOzGGB1syGQFqkykdRg8276jDg80Hclh6xycelj78s7YMNenohIza9lZNeecvnH/8x2fl/PNZrVZ0IKu1ThzAaqcQB3Cozepctb38lTmjSLf5VJ74iR01btS4v9e4cKu1R2t6jrRs5ZJvbE5pWeGR9xncHA1sWaEBQBWe77r9V7KABARjIxXq3BA9Tr6KgdVmIQ5gcHz7zk7qxAEc6lSY1NFKhuPpTZgSk/4oD3a6GAuA1AirfGDvjrFGAiZzxOnXcY74EM2R/2mO/Ol3e+EntzVJNEcUAAA=',
  29. headers: {
  30. "User-Agent": "okhttp/4.6.0"
  31. },
  32. timeout: 5000,
  33. class_name: '电视剧&电影&动漫&综艺&海外精选', // /api.php/provide/home_nav
  34. class_url: '2&1&4&3&46',
  35. limit: 20,
  36. play_parse: true,
  37. lazy: `js:
  38. try {
  39. function getvideo(url) {
  40. let jData = JSON.parse(request(url, {
  41. headers: getHeaders(url)
  42. }));
  43. if (jData.code == 1) {
  44. return jData.data.url
  45. } else {
  46. return 'http://43.154.104.152:1234/jhapi/cs.php?url=' + url.split('=')[1]
  47. }
  48. }
  49. if (/,/.test(input)) {
  50. let mjurl = input.split(',')[1]
  51. let videoUrl = getvideo(mjurl);
  52. input = {
  53. jx: 0,
  54. url: videoUrl,
  55. parse: 0,
  56. header: JSON.stringify({
  57. 'user-agent': 'Lavf/58.12.100'
  58. })
  59. }
  60. } else {
  61. let videoUrl = getvideo(input);
  62. if (/jhapi/.test(videoUrl)) {
  63. videoUrl = getvideo(videoUrl);
  64. input = {
  65. jx: 0,
  66. url: videoUrl,
  67. parse: 0,
  68. header: JSON.stringify({
  69. 'user-agent': 'Lavf/58.12.100'
  70. })
  71. }
  72. } else {
  73. input = {
  74. jx: 0,
  75. url: videoUrl,
  76. parse: 0
  77. }
  78. }
  79. }
  80. } catch (e) {
  81. log(e.toString())
  82. }
  83. `,
  84. 推荐: `js:
  85. var d = [];
  86. let html = request(input, {
  87. headers: getHeaders(input)
  88. });
  89. html = JSON.parse(html);
  90. html.forEach(function(it) {
  91. d.push({
  92. title: it.name,
  93. img: it.img,
  94. desc: it.remarks,
  95. url: it.id
  96. })
  97. });
  98. setResult(d);
  99. `,
  100. 一级: `js:
  101. var d = [];
  102. let html = request(input, {
  103. headers: getHeaders(input)
  104. });
  105. html = JSON.parse(html);
  106. html.list.forEach(function(it) {
  107. d.push({
  108. title: it.name,
  109. img: it.img,
  110. desc: it.msg,
  111. url: it.id
  112. })
  113. });
  114. setResult(d);
  115. `,
  116. 二级: `js:
  117. var d = [];
  118. VOD = {
  119. vod_id: input.split('id=')[1]
  120. };
  121. try {
  122. let html = request(input, {
  123. headers: getHeaders(input)
  124. });
  125. html = JSON.parse(html);
  126. let node = html.data;
  127. VOD = {
  128. vod_name: node['name'],
  129. vod_pic: node['img'],
  130. type_name: node['type'],
  131. vod_year: node['year'],
  132. vod_remarks: '更新至: ' + node['msg'] + ' / 评分: ' + node['score'],
  133. vod_content: node['info'].strip()
  134. };
  135. let episodes = node.player_info;
  136. let playMap = {};
  137. if (typeof play_url === 'undefined') {
  138. var play_url = ''
  139. }
  140. episodes.forEach(function(ep) {
  141. let playurls = ep['video_info'];
  142. playurls.forEach(function(playurl) {
  143. let source = ep['show'];
  144. if (!playMap.hasOwnProperty(source)) {
  145. playMap[source] = []
  146. }
  147. playMap[source].append(playurl['name'].strip() + '$' + play_url + urlencode(playurl['url']))
  148. })
  149. });
  150. let playFrom = [];
  151. let playList = [];
  152. Object.keys(playMap)
  153. .forEach(function(key) {
  154. playFrom.append(key);
  155. playList.append(playMap[key].join('#'))
  156. });
  157. let vod_play_from = playFrom.join('$$$');
  158. let vod_play_url = playList.join('$$$');
  159. VOD['vod_play_from'] = vod_play_from;
  160. VOD['vod_play_url'] = vod_play_url
  161. } catch (e) {
  162. log('获取二级详情页发生错误:' + e.message)
  163. }
  164. `,
  165. 搜索: `js:
  166. var d = [];
  167. let html = request(input, {
  168. headers: getHeaders(input)
  169. });
  170. html = JSON.parse(html);
  171. html.data.forEach(function(it) {
  172. d.push({
  173. title: it.video_name,
  174. img: it.img,
  175. desc: it.qingxidu + '/' + it.category,
  176. url: it.id,
  177. content: it.blurb
  178. })
  179. });
  180. setResult(d);
  181. `,
  182. }